#!/bin/sh

[ -r /etc/default/console-setup ] && . /etc/default/console-setup

ACTIVE_CONSOLES=$(
    for tty in $ACTIVE_CONSOLES; do
        if [ -e $tty ]; then
            echo $tty
        fi
    done
)

for tty in $ACTIVE_CONSOLES; do
    tty=${tty##*/}
    [ -f /etc/dinit.d/agetty-$tty ] || continue
    /usr/bin/dinitctl start agetty-$tty > /dev/null &
done

wait || :
